package cool.mtc.minghe.data.model.sys.menu.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 明河
 */
@Data
public class MenuDictDTO implements MenuTreeSupport {

    @JsonIgnore
    private Long menuParentId;

    @JsonIgnore
    private Long menuId;

    @JsonProperty(value = "title")
    private String name;
    @JsonProperty(value = "key")
    private String code;

    private int level;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<MenuDictDTO> children = new ArrayList<>();

    private String value;

    public String getValue() {
        return String.valueOf(this.getMenuId());
    }
}
